import request from '@/utils/request'

/**
 * 条件分页查询项目数据
 * @param {*} query 
 * @returns 
 */
export const getProjectListService = (query) => {
    return request.get('/admin/project/page', {
        params: query
    })
}

/**
 * 批量删除
 * @param {*} ids 
 * @returns 
 */
export const deleteBatchService = (ids) => {
    return request.delete('/admin/project', {
        data: ids
    })
}

/**
 * 新增文章
 * @param {*} dto 
 * @returns 
 */
export const addProjectService = (dto) => {
    return request.post('/admin/project/save',dto)
}

/**
 * 批量修改项目状态字段
 * @param {*} query 
 * @returns 
 */
export const updateStatusBatchService = (query) => {
    return request.put('/admin/project/status',query)
}

/**
 * 根据id查询项目数据
 * @param {*} id 
 * @returns 
 */
export const getByIdService = (id) => {
    return request.get(`/admin/project/${id}`)
}

/**
 * 根据id修改文章数据
 * @param {*} dto 
 * @returns 
 */
export const updateById = (dto) => {
    return request.put('/admin/project/update', dto)
}